A load balancer is a server that manages an internet protocol (“IP”) address and port. The load balancer manages a number of servers, referred to as “target stacks.” When the load balancer receives a request for an IP address and/or port on a target stack that it is managing, the load balancer makes a selection from the target stacks capable of processing the request and forwards the request to the selected target stack. The metrics that a load balancer uses to select a target stack varies among implementations. Some load balancers use a simple round-robin metric, providing an even distribution of new requests among all target stacks. Other load balancers may factor the capacity and health of the target stacks into the selection process.
As long as the target stacks are all capable of handling the same requests received by the load balancer, conventional load balancing algorithms can be used. However, this is not always the case. In large server farms, it is sometimes necessary to partition the applications and data used to generate responses to queries among multiple servers. As such, a given target stack may only be able to process a subset of the overall requests received from a client.
A “content-based” load balancer is designed to handle these and other types of configurations. When a content-based load balancer receives a new connection from a client, it accepts the connection and, for Transmission Control Protocol (TCP), completes a 3-way handshake. The client then sends the initial query, which is examined by the load balancer. The load balancer then selects a target stack capable of handling the specific request from the set of available targets. Since the load balancer has terminated the connection with the client, it uses a separate connection to the target stack (either a long-running connection or a new connection) to relay the client's request.
There can be disadvantages to conventional content-based load balancers. First, for each client connection, the load balancer may terminate the TCP connection. This means the load balancer may be required to perform all TCP processing (e.g., the 3-way handshake) whenever it communicates with the client (e.g., manage windows, segmentation/reassembly, and so on). Additionally, the load balancer may be required to maintain one or more TCP connections to each target server, which can entail additional TCP processing overhead. Termination and creation of these TCP connections can adversely affect load balancer performance when traffic is great.
Another potential disadvantage of conventional content-based load balancers is that the load balancer may be required to process all inbound and outbound traffic between the client and the target stack. For example, when the request is received from the client, the load balancer can be required to receive the client request and forward it to the target stack. Likewise, the load balancer can be required to receive responses from the target server and forward the responses over the TCP connection to the client. This intermediate processing may not only reduce the capacity of the load balancer, but also increase latency between the client and the target stack.
Secure Sockets Layer (“SSL”) and Transport Layer Security (“TLS”) are encryption protocols that can be used to provide secure communications over the internet. SSL/TLS can be used to provide security for many applications, including web browsing, e-mail, instant messaging, and data transfers, for example. When using SSL/TLS to protect data sent to a conventional load balancer, the load balancer must terminate the SSL/TLS connection with the client, and maintain a separate SSL/TLS connection to an application running on the target stack. For data sent from the client to the target stack, the load balancer is usually required to decrypt the data received on the TCP connection with the client. After selecting a target stack, the load balancer generally re-encrypts the data before transferring the data to the application on the target server. Likewise, when the target stack sends data to the client, the load balancer is usually required to decrypt the data received from the target stack and re-encrypt the data before sending to the client. The decryption and re-encryption of data can be resource intensive for the load balancer, and can reduce the number of clients the load balancer can serve at any given time and/or lead to increased latency.
Also, some applications require that the client's SSL/TLS certificate be sent to the target stack before the target stack returns the requested data. In order to make the client's SSL/TLS certificate available on the target stack, conventional load balancers usually are required to use a protocol-specific (and often times proprietary) mechanism to pass the certificate.